package com.sdy.supermarket.biz.service;

import com.sdy.common.model.BizException;
import com.sdy.supermarket.biz.model.GsNotice;
import com.sdy.supermarket.biz.model.GsUserNotice;
import com.sdy.mvc.service.BaseService;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author hyh
 * @since 2019-08-20
 */
public interface GsUserNoticeService extends BaseService<GsUserNotice> {

    /**
     * 发布通知后给用户添加未读消息，如果传入了idList就只给idList列表的用户设置未读，否则视为全部
     *
     * @param noticeId
     * @param idList
     * @return
     * @throws BizException
     */
    int addAllUserUnReadNotice(Integer noticeId, List<Integer> idList) throws BizException;

    /**
     * 将用户已读的通知从未读列表去除
     *
     * @param userId
     * @param noticeId
     * @return
     * @throws BizException
     */
    int noticeHaveRead(Integer userId, Integer noticeId) throws BizException;


    /**
     * 根据用户id 获取到该用户所有的未读通知
     *
     * @param userId
     * @return
     * @throws BizException
     */
    List<GsNotice> UnReadNotice(Integer userId) throws BizException;

}
